package com.tianqu.tms.www.car.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.entity.Codes;
import com.tianqu.tms.entity.Member;
import com.tianqu.tms.www.car.actionform.CarStockModifyForm;
import com.tianqu.tms.www.car.controller.CarStockModifyController;
import com.tianqu.tms.www.car.viewhelper.CarStockModifyViewhelper;

public class CarStockModifyDetailAction extends TmsAction{
	private Logger logger = Logger.getLogger(CarStockCountListTopAction.class);
	
	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response, UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");
		 
		//
		CarStockModifyController controller = new CarStockModifyController();
		controller.execute(uc);
		
		//
		CarStockModifyViewhelper viewhelper = (CarStockModifyViewhelper) uc.getAttribute(TmsConstants.VIEWHELP);
		Codes code = Codes.getInstance();
		Member menber = Member.getInstance();
		viewhelper.setCardTypeList(code.getCodeslistByItemId(Codes.PLATE_TYPE));// 号牌种类list
		viewhelper.setMemberList(menber.findAllMemInfo(1));// 会员类型  modify by huangwei st2
		viewhelper.setGearBoxList(code.getCodeslistByItemId(Codes.GEARBOX_TYPE));//变速箱类型list
		viewhelper.setColorList(code.getCodeslistByItemId(Codes.VEHICLE_COLOR));// 车辆颜色
		request.setAttribute(TmsConstants.VIEWHELP, viewhelper);
		return mapping.findForward(TmsConstants.SUCCESS);
	}

}
